<?php
namespace Home\Controller;
use Think\Controller;
class WxinController extends Controller {
    //月子中心id
    public function lists(){
        $this->display();
    }
    public function comm(){
        $name=I("request.name");
        $garden=I("request.garden");
        $phone=I("request.phone");
        $is=I("request.is");
        $data['create_time']=time();
        $data['name']=$name;
        $data['garden']=$garden;
        $data['phone']=$phone;
        $data['is_zd']=$is;
        $registration_information=D("RegistrationInformation");
        $registration_information-> add($data); 
        //营销账号
                $username = '70211845';   //18601735575        
		$password = '65d08a6ad15b2281e65fb5dc0adeeb71';
                $content="恭喜您成功报名参加2016年5月22日 13：30在上海市浦东新区张扬路777号锦江汤臣洲际大酒店举办的美国试管领域大咖现场座谈会，期待您的准时参加！详情请咨询40061-75751。";
		$http = 'http://api.duanxin.cm/?action=send&username='.$username.'&password='.$password.'&phone='.$phone.'&content='.urlencode( iconv('utf-8','gbk',$content) );
		$ch=curl_init();
		curl_setopt($ch,CURLOPT_URL,$http);
		curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
		$data = curl_exec($ch);
		curl_close($ch);
                print_r($data);
        echo json_encode(1);
    }
}